{literal}
<script type="text/javascript" language="javascript">

jQuery(document).ready(function(){
jQuery('#username').focus(function(){ if( jQuery(this).val()== 'Keyword' ) jQuery(this).val('');});
jQuery('#username').blur(function(){ if( jQuery(this).val()== '' ) jQuery(this).val('Keyword');});
jQuery.fn.autosugguest({  
           className: 'ausu-suggest',
          methodType: 'POST',
            minChars: 2,
              rtnIDs: true,
            dataFile: 'autopopulate.php?action=populateCity'
    });
/* right panel filter more/less links */
	var filterThreshold = 5;
	jQuery('.listing').each(function(i){
	if(jQuery(this).find('a.selected').length == 0){
		jQuery(this).find('li:gt('+(filterThreshold-1)+')').hide();
		if(jQuery(this).find('li').length > filterThreshold)
			jQuery(this).after('<li class="more"><a href="#"><em><span>+ more</span></em></a></li><li style="clear:both; width:100%"></li>');
		else
			jQuery(this).after('');
	}
	});

	jQuery('.more').each(function(i){
		jQuery(this).toggle(function(){
		jQuery(this).prev().find('li:gt('+(filterThreshold-1)+')').slideDown('fast');
		jQuery(this).html('<li class="more"><a href="#"><em><span>- less</span></em></a></li><li style="clear:both; width:100%"></li>');
		},function(){
		jQuery(this).prev().find('li:gt('+(filterThreshold-1)+')').slideUp('fast');
		jQuery(this).html('<li class="more"><a href="#"><em><span>+ more</span></em></a></li><li style="clear:both; width:100%"></li>');
		});
	});
	jQuery('.refine').click(function(){
	
		var val = jQuery(this).attr('typeId');
		var type = jQuery(this).attr('stype');
		
		if(type =='L')
		{
		    if(jQuery('#ladder_'+val).attr('checked'))
				jQuery('#ladder_'+val).removeAttr('checked');
			else
				jQuery('#ladder_'+val).attr('checked','true');
		}
		else if(type =='R')
		{
			if(jQuery('#race_'+val).attr('checked'))
				jQuery('#race_'+val).removeAttr('checked');
			else
			jQuery('#race_'+val).attr('checked','true');
		}	
		else if(type =='S')
		{
			if(jQuery('#server_'+val).attr('checked'))
				jQuery('#server_'+val).removeAttr('checked');
			else
			jQuery('#server_'+val).attr('checked','true');
		}
		else if(type =='X')
		{
			if(jQuery('#region_'+val).attr('checked'))
				jQuery('#region_'+val).removeAttr('checked');
			else
			jQuery('#region_'+val).attr('checked','true');
		}
		else if(type =='Y')
		{
			if(jQuery('#rating_'+val).attr('checked'))
			jQuery('#rating_'+val).removeAttr('checked');
			else
			jQuery('#rating_'+val).attr('checked','true');
		}		
		else if(type =='A')
		{
			if(jQuery('#avail_'+val).attr('checked'))
			jQuery('#avail_'+val).removeAttr('checked');
			else
			 jQuery('#avail_'+val).attr('checked','true');
		}	 
		

		else
		{
			if(jQuery('#language_'+val).attr('checked'))
			jQuery('#language_'+val).removeAttr('checked');
			else
			jQuery('#language_'+val).attr('checked','true');
			
		}
		frmRefine_POST();
	});
  });	
</script>
<link rel="stylesheet" href="slider/stylesheets/jslider.css" type="text/css">
<link rel="stylesheet" href="slider/stylesheets/jslider.plastic.css" type="text/css">
<!--<script type="text/javascript" src="slider/javascripts/jquery-1.4.2.js"></script>-->
<script type="text/javascript" src="slider/javascripts/jquery.dependClass.js"></script>
<script type="text/javascript" src="slider/javascripts/jquery.slider-min.js"></script>
<script type='text/javascript'>
function frmRefine_POST()
{
  var data = jQuery(document.frmRefine).serialize();
  jQuery('#loading').html('<p><img src="images/bar-loader.gif" alt="Loading..." /></p>');
  jQuery.ajax({
	type: "GET",
	url: 'findcoach2.php',
	data: data+'&game_id='+ jQuery('#game_id option:selected').val(),			
	dataType: 'html',
	success: function(data)
	{				
	   jQuery('.container-inner').html(data+"<div class='clear'></div>");
	   //alert(data);
	   jQuery('#loading').html('');
	}
});
}
function CreateCountry()
{
    var cityid = jQuery('#cityid').val();
	var city = jQuery('#city').val();
	if(cityid !='' && city!='')
	{
		 document.getElementById('availability_city').value=cityid;
		 goto();
	}
    else
	{
	     document.getElementById('availability_city').value='';
		 goto();
	}
}
function subForm(a){
//alert(a);
	document.getElementById('listfor').value='sorting';
	document.getElementById('sortingby').value=a;
	goto();
}
function avail_submit(c){
	document.getElementById('availability_country').value=c;
	goto();
}
function searchUser()
{
   var username = jQuery('#username').val();
   if(username == '' || username =='Keyword')
    jQuery('#username').css('border','1px solid red');
   else
   {
     document.getElementById('unm').value=username;
	 goto();
   }	 	
}
function resetSearch()
{
     document.getElementById('unm').value='';
	 goto();
   	 	
}
function goto(){
	frmRefine_POST();
}
</script>
{/literal}
<div class="left-panel">
<div class="left-search">
       <form action="findcoach.php" method="post" id="leftsearchfindcoach">
       <fieldset>
	  
       <select name="game_id" id="game_id">
			{html_options options=$GameArr selected=$game_id}
	   </select>
	    
       <!--<input name="" value="Go" class="go" type="submit" />-->
	   <a class="button" href="#" style="float: right;min-width: 30px;padding: 0 3px; margin: 0;" onclick="document.getElementById('leftsearchfindcoach').submit();">Go</a>
	   <div style="background:#ccc; width:250px; float:left; display:block; top:40px; left:0px; height:37px; border:1px solid #ededed; padding:3px 0 0 5px; position:absolute;"><input name="username" class="text" type="text" id="username" {if $username neq ''}value="{$username}"{else}value="Keyword"{/if} onfocus="this.value=''"/>		
			  <input type="button" value="" onclick="searchUser()" /></div>

       </fieldset>
       </form>
 </div>	
   <div class="graphite demo-container">
	<ul class="accordion" id="accordion-1">
	<form action="findcoach.php" method="post" name="frmRefine">
	<input type="hidden" name="list_for" id="listfor" value="" />
	<input type="hidden" name="sorting_by" id="sortingby" value=""/>
	<input type="hidden" name="unm" id="unm" value="{$username}"/>
	<!--input type="hidden" name="availability_country" id="availability_country" value="{$availability_country}"/-->
	<input type="hidden" name="availability_city" id="availability_city" value="{$availability_city}"/>
	<input type="hidden" name="action" value="send" />
	{if $is_ladder eq 'Y'}
	 {if $Numgame neq '0'}
	    <li><a href="#">Ladder</a>
        <ul>	
		 <div class="listing">
				 {section name=ladder loop=$ladderArr}
				   	<li>
					<input type="checkbox" name="ladder_id[]" id='ladder_{$ladderArr[ladder].ladder_id}' value="{$ladderArr[ladder].ladder_id}" style="display:none;"
					{if $ladderArr[ladder].ladder_id|in_array:$ladder_id} checked="checked" {/if}/>
					<a href="javascript:;" class="refine {if $ladderArr[ladder].ladder_id|in_array:$ladder_id} selected {/if}" stype="L" typeId="{$ladderArr[ladder].ladder_id}"> 
					{$ladderArr[ladder].ladder_name} ({$ladderArr[ladder].cnt}) </a> </li>
                 {/section}
				 
		 </div>		 
		 </ul>
	   </li>	 
	 {/if}	
	{/if} 
	{if $is_race eq 'Y'}
	 {if $Numrace neq '0'}
	    <li><a href="#">Race</a>
        <ul>	
		 <div class="listing">
				 {section name=race loop=$raceArr}
				   	<li>
					<input type="checkbox" name="race_id[]" id='race_{$raceArr[race].race_id}' value="{$raceArr[race].race_id}" style="display:none" 
					{if $raceArr[race].race_id|in_array:$race_id} checked="checked" {/if}/>
					<a href="#" class="refine {if $raceArr[race].race_id|in_array:$race_id} selected {/if}" stype="R" typeId="{$raceArr[race].race_id}"> 
					{$raceArr[race].race_title} ({$raceArr[race].cnt}) </a> </li>
                 {/section}
				 
		 </div>		 
		 </ul>
	   </li>	 
	 {/if}	
	{/if} 
	{if $is_server eq 'Y'}
	 {if $Numserver neq '0'}
	    <li><a href="#">Server</a>
        <ul>	
		 <div class="listing">
				 {section name=server loop=$serverArr}
				   	<li>
					<input type="checkbox" name="server_id[]" id='server_{$serverArr[server].server_id}' value="{$serverArr[server].server_id}" style="display:none" 
					{if $serverArr[server].server_id|in_array:$server_id} checked="checked" {/if}/>
					<a href="#" class="refine {if $serverArr[server].server_id|in_array:$server_id} selected {/if}" stype="S" typeId="{$serverArr[server].server_id}"> 
					{$serverArr[server].server_name} ({$serverArr[server].cnt}) </a> </li>
                 {/section}
				 
		 </div>		 
		 </ul>
	   </li>	 
	 {/if}	
	{/if} 
	{if $is_region eq 'Y'}
	 {if $Numregion neq '0'}
	    <li><a href="#">Region</a>
        <ul>	
		 <div class="listing">
				 {section name=region loop=$regionArr}
				   	<li>
					<input type="checkbox" name="region_id[]" id='region_{$regionArr[region].region_id}' value="{$regionArr[region].region_id}" style="display:none;"
					{if $regionArr[region].region_id|in_array:$region_id} checked="checked" {/if}/>
					<a href="#" class="refine {if $regionArr[region].region_id|in_array:$region_id} selected {/if}" stype="X" typeId="{$regionArr[region].region_id}"> 
					{$regionArr[region].region_title} ({$regionArr[region].cnt}) </a> </li>
                 {/section}
				 
		 </div>		 
		 </ul>
	   </li>	 
	 {/if}	
	{/if} 
	{if $is_rating eq 'Y'}
	 {if $Numrating neq '0'}
	    <li><a href="#">Rating</a>
        <ul>	
		 <div class="listing">
				 {section name=rating loop=$ratingArr}
				   	<li>
					<input type="checkbox" name="rating_id[]" id='rating_{$ratingArr[rating].rating_id}' value="{$ratingArr[rating].rating_id}" style="display:none" 
					{if $ratingArr[rating].rating_id|in_array:$rating_id} checked="checked" {/if}/>
					<a href="#" class="refine {if $ratingArr[rating].rating_id|in_array:$rating_id} selected {/if}" stype="Y" typeId="{$ratingArr[rating].rating_id}"> 
					{$ratingArr[rating].rating_title} ({$ratingArr[rating].cnt}) </a> </li>
                 {/section}
				 
		 </div>		 
		 </ul>
	   </li>	 
	 {/if}	
	{/if} 
	<li><a href="#">Rate (Points)</a> 
           <ul>	
				  <li style="height:30px; padding:15px 5px 5px 5px;"> 
				   <span style="display: inline-block; width: 230px; padding: 0 5px; font-size:11px;">
				   <input id="Slider1" type="slider" name="price" value="{$price}"/></span> 
                    {literal}
					 <script type="text/javascript" charset="utf-8">
					  jQuery("#Slider1").slider({ from: 0, to: 100, limits: false, step: 1,smooth: true, round: 0, dimension: '', skin: "plastic", callback: 
					  function( value ){ /* document.frmRefine.submit() */ frmRefine_POST(); } });
					</script>
					{/literal}
				 </li>	
		   </ul>
	</li>  
	{if $Numlanguage neq '0'}	
	     <li><a href="#">Language</a>
            <ul>
			 <div class="listing">
                   
				  {section name=lang loop=$languageArr}
				  	<li>
					<input type="checkbox" name="language_id[]" id="language_{$languageArr[lang].language_id}" value="{$languageArr[lang].language_id}" style="display:none;" 
					{if $languageArr[lang].language_id|in_array:$language_id} checked="checked" {/if} />				
					<a href="#" class="refine {if $languageArr[lang].language_id|in_array:$language_id} selected {/if}" stype="Z" typeId="{$languageArr[lang].language_id}" >
					{$languageArr[lang].language_name} ({$languageArr[lang].cnt})</a>
					</li>
                  {/section}
			  </div> 
			</ul>
		</li>	
	  {/if}	
		 <li><a href="#">Availability</a>
           <ul>
		   <div class="listing">
			 
			  <li> <input type="checkbox" name="availability[]" id="avail_O" value="O" style="display:none" {if 'O'|in_array:$availability} checked="checked" {/if} />
			  <a href="#" class="refine {if 'O'|in_array:$availability} selected {/if}" stype="A" typeId="O"> Online({$avail1Num})</a></li>
			  <li> <input type="checkbox" name="availability[]" id="avail_L" value="L" style="display:none" {if 'L'|in_array:$availability} checked="checked" {/if} />
			  <a href="#" class="refine {if 'L'|in_array:$availability} selected {/if}" stype="A" typeId="L" > Local meet-up({$avail2Num})</a></li>
			  <li id="avail_coun" {if 'L'|in_array:$availability} style="display:block;" {else} style="display:none;" {/if}>
			  &nbsp;&nbsp;&nbsp;
			  <div class="ausu-suggest">
			  <input type="text" name="city" id="city" value="{$city}" autocomplete="off" />
			  <input name="cityid" id="cityid" value="{$availability_city}" type="hidden"  autocomplete="off" />
			  </div>
			  <input type="button" value="Go" onclick="CreateCountry()" class="button" />
			  <br />
			  
			  </li>
			</div>  
		   </ul>
		</li>   
	   
	  <input type="hidden" name="record_per_page" id="record_per_page" value="{$record_per_page}" style="visibility:hidden">
	  <input type="submit" style="visibility:hidden">
	 </form> 	
    </ul>
   </div>   
   </div>